home *** CD-ROM | disk | FTP | other *** search
/ HaCKeRz Kr0nlcKLeZ 1 / HaCKeRz Kr0nlcKLeZ.iso / scriptz / mrv1.exe / MR.ZIP / MR / SCRIPT~1 / SCRIPT~3.TXT < prev    next >
Encoding:
Text File  |  1996-02-12  |  2.9 KB  |  91 lines

  1. Comparing Identifiers and Variables
  2. -----------------------------------
  3. ==          string 1 equal to string 2
  4. !=          string 1 not equal to string 2
  5. <           string 1 less than string 2
  6. >           string 1 larger than string 2
  7. <=          string 1 less than or equal to string 2
  8. >=          string 1 greater than or equal to string 2
  9. //          string 1 multiple of string 2
  10. \\          string 1 not a multiple of string 2
  11. isin        string 1 is in string 2
  12. iswm        wildcard 1 matches string 2
  13. ison        nick 1 is on channel 2
  14. isop        nick 1 is op'd on channel 2
  15. isnum       number 1 is in range 2
  16. ischan      you are on channel 1 
  17. isauto      nick 1 is autoop for channel 2
  18. isignore    nick 1 is in ignore list with ignore swith 2
  19. isprotect   nick 1 is in protect list for channel 2
  20. isnotify    nick 1 is in notify list
  21. &&          and
  22. ||          or
  23.  
  24. Example Comparisons
  25. -------------------
  26. optest {
  27.    if ($$1 isop $$2) {
  28.      echo 4 $$1 does have ops in $$2
  29.      halt
  30.    }
  31.    echo 4 $$1 does not have ops in $$2
  32. }
  33.  
  34. Then when you /optest {nick} {channel} the statment would check to see if {nick} had ops in
  35. {channel} and if they did it would echo 4 {nick} does have ops in {channel} and then halt(stops the
  36. statement right there). If {nick} did not have ops in {channel} it would echo 4 that they did not.
  37.  
  38. jointest {
  39.    if ($me ison $$1) {
  40.      echo 2 You're already on that channel!
  41.      halt
  42.    }
  43.    join $$1
  44. }
  45.  
  46. Now you can /jointest {chan} and the statement will check to see if you($me) are already on(ison)
  47. that channel($$1) and if you are it will echo that you're already on that channel then stop(halt). If
  48. your not on that channel it will join it($$1).
  49.  
  50. awaytest {
  51.    if ($away == $true) {
  52.      echo 5 You are currently marked as being away.
  53.    }
  54.    if ($away == $false) {
  55.      echo 5 You are currently not marked as being away.
  56.    }
  57. }
  58. awaytest2 {
  59.    if ($away == $true) {
  60.      echo 4 Yup, you're away.
  61.    }
  62.    if ($away != $true) {
  63.      echo 4 Nope, you're still here.
  64.    }
  65. }
  66. awaytest3 {
  67.    if ($away == $true) {
  68.      echo 6 Where'd you go?
  69.      halt
  70.    }
  71.    echo 6 You're here.
  72. }
  73. Note: The $away identifier returns $true if you're marked away and $false
  74.       if you are here.
  75.  
  76. There are many different ways to write a single if-then-else statement as shown with the awaytest
  77. statements . They all will do the same thing, but are quite different from each other.
  78.  
  79. timecheck {
  80.    if ($left(2,$time) >= 20) {
  81.      echo 2 It's past your bedtime. mIRC Shutting down. Go to bed.
  82.      quit Goodnight Everyone
  83.      .timer 1 10 /exit
  84.      halt
  85.    }
  86.    echo 2 Its still early, you can chat a while longer.
  87. }
  88.  
  89. This takes the left 2 characters,the hours, from the current time and if its equal to or greater
  90. than(>=) 20(10pm) it tells you to go to bed, quits irc, starts a timer to close mIRC, and stops
  91. there(halt). If its not 10pm yet it says you can stay up a little longer.